/* eslint valid-jsdoc: "off" */

'use strict';
/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1627634156717_3361';

  // add your middleware config here
  config.middleware = ['error', 'auth'];

  //关闭安全验证
  config.security = {
    csrf: {
      enable: false,
    }
  }
  config.jwt = {
    secret: 'a6e8561e-58df-4715-aa21-b5d1a091e71a',
    expiresIn: '10d'
  }
  config.mongoose = {
    client: {
      url: " mongodb://127.0.0.1:27017/world",
      options: {
        useUnifiedTopology: true
      },
    }

  },
    config.cors = {
      origin: '*'
      // {string|Function} origin: '*',
      // {string|Array} allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
    }
  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
